/*
 * MainState.h
 *
 *  Created on: 24-nov.-2013
 *      Author: Axel
 */

#ifndef MAINSTATE_H_
#define MAINSTATE_H_

#include "StateMachine.h"
#include "algebraBasic.h"
#include "LoadShader.h"
#include "Camera.h"
#include "CharacterManager.h"

#include "Mesh.h"

class MainState: virtual public StateMachine {
public:
	MainState(void);
	~MainState(void);

	void updateGame(int timer);
	void renderGame(float interpolation);
	void handleInput(GLFWwindow* window);

	void loadShader(const char* vertex, const char* fragment);

	long stateChanger();
	long getKeyCode();

	void reInit();
	void init();
	void initObjects();

private:
	//Vertex and fragment shaders:
	static const char* pVS;
	static const char* pFS;

	//check whether state has been loaded before
	bool hasBeenLoaded;

	//hold the charactermanager
	CharacterManager* chars;

	//holds the object that loads the shader
	LoadShader* loadshader;
	//the game camera
	Camera* cam;
	//Holds the shader info
	GLuint ShaderProgram;


	GLuint gWorldLocation;

	//keycode for this state
	static const long keycode = 200000000L;
	//check whether we want to change state
	long changeState;
};

#endif /* MAINSTATE_H_ */
